import { GStatic } from "../../../Core/Manager/DataPool";

const { ccclass } = cc._decorator;
@ccclass
export class SOfficerData extends GStatic {
    public parse(obj: any): boolean {
        for (let i = 0; i < obj.data.length; i++) {
            let raw = GStatic.addonRaw<SOfficerDataRaw>(obj.data[i]);
            this._data.set(raw.id, raw);
        }
        return true;
    }

    public getTv(id, index) {
        let adNum = 0;
        this._data.forEach((v: SOfficerDataRaw) => {
            if (v.id == id) {
                adNum = v.tv[index];
            }
        })
        return adNum
    }
}